﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<QianBuo.Lottery.Web.Models.Play.PlayTypeModel>" %>
<%@ Import Namespace="Code.Models" %>
<div id='div_Rdo' align="center">
    <input type="radio" name='rdo' id='rdo1' surl='<%=Url.RouteUrl("Play_Single",new{p1=PlayType_E.QianSanZhiHe}) %>' value='<%=(short)PlayType_E.QianSanZhiHe %>'/><label for='rdo1'>前三和值</label>
    <input type="radio" name='rdo' id='rdo2'surl='<%=Url.RouteUrl("Play_Single",new{p1=PlayType_E.HouSanZhiHe}) %>'  value='<%=(short)PlayType_E.HouSanZhiHe %>'/><label for='rdo2'>后三和值</label>
</div>
<% Html.RenderPartial("ZhiHe", Model); %>
<script type="text/javascript">
    var playTypeID = '<%=Model.ID %>';
    var isSingle=<%="true".Equals(TempData["singleplay"] as string)?"true":"false" %>;
    $("#div_Rdo input").each(function () {
        var rdo = $(this);
        rdo.click(function () {
            if (playTypeID == rdo.val())
                return;
            if(isSingle){
                location.href=rdo.attr('surl');
                return;
            }
            var url='<%=Url.Action("Play",new {p1="!"}) %>/'.replace("!",rdo.val());
            $("#play_bet_bar").block({ message: "<img src='<%=Url.Content("~/Content/images/busy.gif") %>'/>载入中..." });
            $("#play_bet_bar").load(url, null, function (p, e, i) {
                $("#play_bet_bar").unblock();
                if (e == 'success' && $(p).length && $(p).is("#play_inputpanel")) {
                } else {
                    $("#div_Rdo #rdo" + playTypeID).click()
                    return false;
                }
            });
        });
        if (rdo.val() == playTypeID) {
            this.checked = true;
        }
    });
</script>


